package flexo.state;

public abstract class State
{
		
	/**
	 * The class' name of the state that must be loaded after this state.
	 */
	protected String nextState;
	
	/**
	 * Set it to true when this state must be left.
	 */
	protected boolean exit;
	
	public State()
	{
	}
	
	protected float getElapsedTime()
	{
		return flexo.common.System.UPDATE_STANDARD;
	}
	
	public String getNextState()
	{
		return nextState;
	}
	
	public void exit()
	{
		exit = true;
	}
	
	boolean isExit()
	{
		return exit;
	}
	
	/**
	 * Inits the game state objects. Use this as a constructor instead of default one.
	 */
	public abstract void init();
	
	/**
	 * Updates the game state. It's called once per engine update.
	 */
	public abstract void update();	

	/**
	 * Cleans game state objects. Use this as a destructor instead of the default one.
	 */
	public abstract void cleanUp();
}
